
<?php

class GanadoInsumoController extends BaseController {

	/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */

	public function aplicar($id){
		$insumo = Insumo::where('id',$id)->first();
		//$ganados_insumos = GanadoInsumo::all();
		$ganado = Ganado::all();
		$raza = Raza::all();
		$ganadoinsumo = GanadoInsumo::all();
        return View::make("GanadosInsumos/show1")->with('insumo', $insumo)->with('ganados',$ganado)->with('razas',$raza)->with('ganadoinsumos',$ganadoinsumo);
	}

	public function ver($id){
		$insumo = Insumo::where('id',$id)->first();
		$ganadoinsumo = GanadoInsumo::all();
		$ganado = Ganado::all();
		$raza = Raza::all();
        return View::make("GanadosInsumos/ver")->with('insumo', $insumo)->with('ganados',$ganado)->with('razas',$raza)->with('ganadoinsumos',$ganadoinsumo);
	}

	public function index()
	{   
}

	/**
	 * Show the form for creating a new resource.
	 *
	 * @return Response
	 */
	public function create()
	{
		//
	}


	/**
	 * Store a newly created resource in storage.
	 *
	 * @return Response
	 */
	public function store()
	{
		$ganadoinsumo = new GanadoInsumo;
		$ganadoinsumo->id_insumo = Input::get('id_insumo');
		$ganadoinsumo->id_ganado = Input::get('id_ganado');
		$ganadoinsumo->fecha = Input::get('fecha');
		$ganadoinsumo->descirpcion = Input::get('descirpcion');
		$ganadoinsumo->activo = Input::get('activo');
		$ganadoinsumo->save();
		return Redirect::to('insumos/{id}/aplicados')->with('mensaje','Guardado');

	}


	/**
	 * Display the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
		//
	}


	/**
	 * Show the form for editing the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function edit($id)
	{
		//
	}


	/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function update($id)
	{
		//
	}


	/**
	 * Remove the specified resource from storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function destroy($id)
	{
		//
	}


}
